//
//  CZloadingView.swift
//  GZWeibo666
//
//  Created by Yuan on 15/12/3.
//  Copyright © 2015年 itcast. All rights reserved.
//

import UIKit
//MARK: - 菊花控件
class CZloadingView: UITableViewCell {

    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        //准备控件
        prepareUI()
    }
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    //准备控件
    func prepareUI() {
        //添加控件
        contentView.addSubview(loadingView)
        contentView.addSubview(message)
        
        //添加约束
        loadingView.ff_AlignInner(type: ff_AlignType.CenterLeft, referView: contentView, size: CGSize(width: 50, height: 50), offset: CGPoint(x: 100, y: 10))
        message.ff_AlignHorizontal(type: ff_AlignType.CenterRight, referView: loadingView, size: nil, offset: CGPoint(x: CZStatusCellMargin, y: 0))
    }
    //懒加载
    //菊花
    private lazy var loadingView : UIActivityIndicatorView = {
        let view = UIActivityIndicatorView(activityIndicatorStyle: UIActivityIndicatorViewStyle.Gray)
        view.startAnimating()
//        view.backgroundColor = UIColor.blueColor()
        return view
    }()
    //右边文字
    private lazy var message : UILabel = {
        let text = UILabel(color: UIColor.blackColor(), fontSize: 15)
        text.text = "加载更多"
        text.sizeToFit()
        
        return text
    }()
}
